

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>故障维修记录</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
</head>
<body>
  <div class="layui-fluid">   
    <div class="layui-card">
      <div class="plan-title">故障维修记录</div>
      <div class="layui-card-body">
        <div style="padding-bottom: 10px;">
          <button class="layui-btn layuiadmin-btn-admin" data-type="add">添加维修设备</button>
      </div>
          <table id="faultRepairRecord" lay-filter="faultRepairRecord"></table> 
      </div>
    </div>
  </div>
  <script type="text/html" id="taskStatus">
    {{#  if(d.taskStatus == 0){d.taskStatus = '未处理'}}
    {{d.taskStatus = '未处理'}}
    {{#  } else if(d.taskStatus == 1){d.taskStatus ='处理中'}}
    {{d.taskStatus = '处理中'}}
    {{#  } else if(d.taskStatus == 2){d.taskStatus ='搁置'}}
   {{d.taskStatus ='搁置'}}
    {{#  } else {d.taskStatus = '已处理' }}
    {{d.taskStatus ='已处理'}}
    {{#  } }}
  </script>
  <script type="text/html" id="faultOperate">
    {{# if((layui.data(layui.setter.tableName).user_info.menuAndPermissionList.indexOf('equipment_overhaul_page:detailed_info')) > -1){ }}
      <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="detail">设备详情</a>
    {{# } }}
</script>

 <script src="../../layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '../../layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
    , my_send: '../myModules/my_send'
  }).use(['index', 'alarmManagement', 'table','my_send'], function(){
    var $ = layui.$
    ,form = layui.form
    ,table = layui.table
    , http_proxy = layui.http_proxy;
    
    //监听搜索
    form.on('submit(LAY-user-back-search)', function(data){
      var field = data.field;
      
      //执行重载
      table.reload('LAY-user-back-manage', {
        where: field
      });
    });
  
    //事件
    var active = {
      batchdel: function(){
        var checkStatus = table.checkStatus('LAY-user-back-manage')
        ,checkData = checkStatus.data; //得到选中的数据

        if(checkData.length === 0){
          return layer.msg('请选择数据');
        }
        
        layer.prompt({
          formType: 1
          ,title: '敏感操作，请验证口令'
        }, function(value, index){
          layer.close(index);
          
          layer.confirm('确定删除吗？', function(index) {
            
            //执行 Ajax 后重载
            /*
            admin.req({
              url: 'xxx'
              //,……
            });
            */
            table.reload('LAY-user-back-manage');
            layer.msg('已删除');
          });
        }); 
      }
      ,add: function(){
        layer.open({
          type: 2
          ,title: '添加维修设备'
          ,content: '../equipment/equipmentRecord.html'
          ,area: ['95%', '95%']
        }); 
      }
    }  
    $('.layui-btn.layuiadmin-btn-admin').on('click', function(){
      var type = $(this).data('type');
      active[type] ? active[type].call(this) : '';
    });
  });
  </script>
</body>
</html>

